#define _CRT_SECURE_NO_WARNINGS 1

class Solution
{
public:
    int firstUniqChar(string s)
    {
        unordered_map<int, int> count;
        for (auto ch : s)
            count[ch]++;
        for (int i = 0; i < s.size(); i++)
        {
            if (count[s[i]] == 1) return i;
        }

        return-1;
    }
};